/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}


/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	var _MotionAndOrientation = __webpack_require__(1);

	var _MotionAndOrientation2 = _interopRequireDefault(_MotionAndOrientation);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

	var motionandorientation = new _MotionAndOrientation2.default();
	var motion = motionandorientation.rotate();
	// import Test from '../src/test.js'
	// var test = new Test();

/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

	var _DeviceMotion = __webpack_require__(2);

	var _DeviceMotion2 = _interopRequireDefault(_DeviceMotion);

	var _DeviceOrientation = __webpack_require__(4);

	var _DeviceOrientation2 = _interopRequireDefault(_DeviceOrientation);

	var _test = __webpack_require__(5);

	var _test2 = _interopRequireDefault(_test);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

	var MAO = function () {
	    function MAO() {
	        _classCallCheck(this, MAO);
	    }

	    _createClass(MAO, [{
	        key: 'getMotion',
	        value: function getMotion() {
	            return new _DeviceMotion2.default();
	        }
	    }, {
	        key: 'getOrientation',
	        value: function getOrientation() {
	            return new _DeviceOrientation2.default();
	        }
	    }, {
	        key: 'shake',
	        value: function shake() {}
	    }, {
	        key: 'rotate',
	        value: function rotate() {
	            var orientation = this.getOrientation();
	            var motion = this.getMotion();
	        }
	    }]);

	    return MAO;
	}();

	module.exports = MAO;

/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

	var _ktools = __webpack_require__(3);

	var _ktools2 = _interopRequireDefault(_ktools);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

	var tools = _ktools2.default.tools;
	console.log(112);
	console.log(tools);

	var DeviceMotion = function () {
	    function DeviceMotion() {
	        _classCallCheck(this, DeviceMotion);

	        this.init();
	    }

	    _createClass(DeviceMotion, [{
	        key: 'init',
	        value: function init() {
	            var container2 = document.querySelector('.container2');
	            if (this.isDeviceMotionEventSupported()) {
	                (function () {
	                    var shakeHandle = function shakeHandle() {
	                        var minTHRESHOLD = 20e-12;
	                        var maxTHRESHOLD = 9e-12;
	                        var currenTime = new Date().getTime();
	                        var x = void 0,
	                            y = void 0,
	                            z = void 0,
	                            last_x = 0,
	                            last_y = 0,
	                            last_z = 0,
	                            last_time = 0;
	                        x = event.accelerationIncludingGravity.x;
	                        y = event.accelerationIncludingGravity.y;
	                        z = event.accelerationIncludingGravity.z;
	                        var speed = Math.abs(x + y + z - last_x - last_y - last_z) / (currenTime - last_time);
	                        container2.innerHTML = '======================<br>motion:<br>acceleration:<br>x:' + event.acceleration.x + '<br>y:' + event.acceleration.y + '<br>z:' + event.acceleration.z + '<br> accelerationIncludingGravity:<br>x:' + event.accelerationIncludingGravity.x + '<br>y:' + event.accelerationIncludingGravity.y + '<br>z:' + event.accelerationIncludingGravity.z + '<br> interval:' + event.interval + '<br>speed1:' + speed + '<br>' + 100e-12;
	                        if (speed > maxTHRESHOLD) {
	                            window.removeEventListener('devicemotion', shakeHandle);
	                            tools.execCallBack();
	                        }
	                        last_x = x;
	                        last_y = y;
	                        last_z = z;
	                        last_time = currenTime;
	                    };

	                    window.addEventListener('devicemotion', shakeHandle);
	                })();
	            } else {
	                alert('devicemotion event not supported');
	            }
	            return this;
	        }
	    }, {
	        key: 'shake',
	        value: function shake(cb, cb2) {}
	    }, {
	        key: 'shakeAfter',
	        value: function shakeAfter() {
	            window.addEventListener('devicemotion', shakeHandle);
	        }
	    }, {
	        key: 'isDeviceMotionEventSupported',
	        value: function isDeviceMotionEventSupported() {
	            if (window.DeviceMotionEvent) {
	                return true;
	            }
	            return false;
	        }
	    }]);

	    return DeviceMotion;
	}();

	module.exports = DeviceMotion;

/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	Object.defineProperty(exports, "__esModule", {
		value: true
	});

	var _tools = __webpack_require__(6);

	var _tools2 = _interopRequireDefault(_tools);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

	var ktools = {
		tools: _tools2.default,
		extend: _tools2.default
	};
	exports.default = ktools;

/***/ },
/* 4 */
/***/ function(module, exports) {

	'use strict';

	var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

	var DeviceOrientation = function () {
	    function DeviceOrientation() {
	        _classCallCheck(this, DeviceOrientation);

	        this.init();
	        this.rotate = {};
	    }

	    _createClass(DeviceOrientation, [{
	        key: 'init',
	        value: function init() {
	            var container1 = document.querySelector('.container1');
	            if (this.isDeviceOrientationEventSupported()) {
	                window.addEventListener('deviceorientation', function (event) {
	                    container1.innerHTML = 'orientation:<br>alpha:' + event.alpha + '<br> beta:' + event.beta + '<br> gamma:' + event.gamma;
	                });
	            } else {
	                alert('deviceorientation event not supported');
	            }
	        }
	    }, {
	        key: 'isDeviceOrientationEventSupported',
	        value: function isDeviceOrientationEventSupported() {
	            if (window.DeviceOrientationEvent) {
	                return true;
	            }
	            return false;
	        }
	    }]);

	    return DeviceOrientation;
	}();

	module.exports = DeviceOrientation;

/***/ },
/* 5 */
/***/ function(module, exports) {

	'use strict';

	var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

	var Test = function () {
	    function Test() {
	        _classCallCheck(this, Test);

	        this.init();
	    }

	    _createClass(Test, [{
	        key: 'init',
	        value: function init() {
	            var container1 = document.querySelector('.container1');
	            var container2 = document.querySelector('.container2');
	            if (this.isDeviceOrientationEventSupported()) {
	                window.addEventListener('deviceorientation', function (event) {
	                    container1.innerHTML = 'orientation:<br>alpha:' + event.alpha + '<br> beta:' + event.beta + '<br> gamma:' + event.gamma;
	                });
	            } else {
	                alert('deviceorientation event not supported');
	            }
	            if (this.isDeviceMotionEventSupported()) {
	                window.addEventListener('devicemotion', function (event) {
	                    container2.innerHTML = '======================<br>motion:<br>acceleration:<br>x:' + event.acceleration.x + '<br>y:' + event.acceleration.y + '<br>z:' + event.acceleration.z + '<br> accelerationIncludingGravity:<br>x:' + event.accelerationIncludingGravity.x + '<br>y:' + event.accelerationIncludingGravity.y + '<br>z:' + event.accelerationIncludingGravity.z + '<br> interval:' + event.interval;
	                });
	            } else {
	                alert('devicemotion event not supported');
	            }
	            return this;
	        }
	    }, {
	        key: 'getEvent',
	        value: function getEvent() {
	            return this.event;
	        }
	    }, {
	        key: 'isDeviceOrientationEventSupported',
	        value: function isDeviceOrientationEventSupported() {
	            if (window.DeviceOrientationEvent) {
	                return true;
	            }
	            return false;
	        }
	    }, {
	        key: 'isDeviceMotionEventSupported',
	        value: function isDeviceMotionEventSupported() {
	            if (window.DeviceMotionEvent) {
	                return true;
	            }
	            return false;
	        }
	    }]);

	    return Test;
	}();

	module.exports = Test;

/***/ },
/* 6 */
/***/ function(module, exports) {

	'use strict';

	var Tools = {
	    /**
	     * 传入一个回调函数名,和参数，判断是否是函数，如果是，则回调
	     * @param  {String} a 函数名
	     * @param  {字符串,也可以是json字符串} b 回调函数的参数
	     * @return {[type]}   [description]
	     */
	    execCallBack: function execCallBack(a, b) {
	        var params = b || {};
	        if (this.isfun(a)) {
	            a.call(this, params);
	        }
	    },
	    execCB: function execCB(a, err, b) {
	        var params = b || {};
	        if (this.isfun(a)) {
	            a.call(this, err, params);
	        }
	    },
	    isfun: function isfun(a) {
	        if (typeof a === 'function') {
	            return true;
	        }
	    },
	    guid: function guid() {
	        function S4() {
	            return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);
	        }
	        return S4() + S4() + S4() + S4() + S4() + S4() + S4() + S4();
	    },
	    getVerifyCode: function getVerifyCode() {
	        return ((1 + Math.random()) * 0x10000 | 0).toString(8).substring(2);
	    }
	};

	module.exports = Tools;
	Tools.browser = {
	    versions: function versions() {
	        var u = navigator.userAgent,
	            app = navigator.appVersion;
	        return { //移动终端浏览器版本信息   
	            trident: u.indexOf('Trident') > -1, //IE内核  
	            presto: u.indexOf('Presto') > -1, //opera内核  
	            webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核  
	            gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核  
	            mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端  
	            ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端  
	            android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器  
	            iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器  
	            iPad: u.indexOf('iPad') > -1, //是否iPad    
	            webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部  
	        };
	    },
	    language: (navigator.browserLanguage || navigator.language).toLowerCase(),
	    isMobile: function isMobile() {
	        if (browser.versions().mobile || browser.versions().ios || browser.versions().android || browser.versions().iPhone || browser.versions().iPad) {
	            return true;
	        } else {
	            return false;
	        }
	    }
	};

/***/ }
/******/ ]);